#ifndef Importer_H
#define Importer_H
#include "Defines.h"
#include "Texture.h"
#include "Sprites.h"
#include "Font.h"
#include "Renderer.h"
#include "XMLParser.h"
#include "TileMap.h"
#include<D3DX9.h>
class ENGINE_API Importer
{
public:
	Importer (Renderer* p_pRenderer){m_pRenderer = p_pRenderer;}//despues lo hago singletone
	~Importer ();
	//-----------------------------------------------
	void Import (const char * p_sXMLPath);
	Texture* GetTexture (std::string p_sTextureName);
	Sprites* GetSprite(std::string p_sSpriteName);	
	TileMap* GetTileMap(std::string p_sTileMapName);
	//-----------------------------------------------
private:
	//-----------------------------------------------
	void AddTilesToMap(TileMap *);
	bool LoadTexture (std::string p_TextureName);
	bool LoadFonts (std::string p_FontName);
	bool LoadSprite (std::string p_SpriteName);
	bool LoadTileMap(std::string p_SpriteName);
	AnimationInfo GetAnimations(XMLNode& p_nAnimations);
	//-----------------------------------------------
	

	std::string m_sXMLTexturePath;
	std::string m_sXMLSpritePath;
	std::string m_sXMLFontPath;
	std::string m_sXMLScenePath;
	std::string m_sXMLTileMapPath;

	std::vector<CharData> m_vCharacters;
	Renderer* m_pRenderer;
	std::map<std::string, Texture*>::iterator m_mTextureIterator;
	std::map<std::string, Texture*> m_mTexturesMap;	

	std::map<std::string, Sprites*>::iterator m_mSpriteIterator;
	std::map<std::string, Sprites*> m_mSpriteMap;

	std::map<short, Sprites*>::iterator m_mFontIterator;
	std::map<short, Sprites*> m_mFontMap;	
	
	std::map<std::string, TileMap*>::iterator m_mTileMapIterator;
	std::map<std::string, TileMap*> m_mTileMap;	

};
#endif 
